<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
      <link rel="stylesheet" href="./../../helpwin.css">
      <title>MATLAB File Help: prtClassMatlabTreeBagger/prtClassMatlabTreeBagger</title>
   </head>
   <body>
      <!--Single-page help-->
      <table border="0" cellspacing="0" width="100%">
         <tr class="subheader">
            <td class="headertitle">MATLAB File Help: prtClassMatlabTreeBagger/prtClassMatlabTreeBagger</td>
            
            
         </tr>
      </table>
      <div class="title">prtClassMatlabTreeBagger/prtClassMatlabTreeBagger</div>
      <div class="helptext"><pre><!--helptext -->  <span class="helptopic">prtClassMatlabTreeBagger</span>  TreeBagger classifier using the MATLAB function "treeBagger.m" (requires statistics toolbox)
 
   CLASSIFIER = <span class="helptopic">prtClassMatlabTreeBagger</span> returns a tree-bagger
   classifier build using the MATLAB Statistics toolbox (additonal 
   product, not included).  As an alternative, consider using
   prtClassTreeBaggingCap, which also implements a random forest
   classification scheme.
 
   A <span class="helptopic">prtClassMatlabTreeBagger</span> object inherits all properties from the
   abstract class prtClass. In addition is has the following
   properties:
  
    nTrees - The number of trees to use in the MATLAB TreeBagger
 
    treeBaggerParamValuePairs - A cell array of parameter value pairs
    to be passed to the MATLAB function "treeBagger". A complete list
    of the valid parameters and their allowed values can be found in
    the help entru for "treeBagger.m"
 
   % Example usage:
 
    TestDataSet = prtDataGenBimodal;       % Create some test and
    TrainingDataSet = prtDataGenBimodal;   % training data
    classifier = <span class="helptopic">prtClassMatlabTreeBagger</span>;           % Create a classifier
    classifier = classifier.train(TrainingDataSet);    % Train
    classified = run(classifier, TestDataSet);         % Test
    subplot(2,1,1);
    classifier.plot;
    subplot(2,1,2);
    [pf,pd] = prtScoreRoc(classified,TestDataSet);
    h = plot(pf,pd,'linewidth',3);
    title('ROC'); xlabel('Pf'); ylabel('Pd');
 
  % Example usage setting the treeBaggerParamValuePairs cell array:
    TestDataSet = prtDataGenBimodal;       % Create some test and
    TrainingDataSet = prtDataGenBimodal;   % training data
    classifier = <span class="helptopic">prtClassMatlabTreeBagger</span>('treeBaggerParamValuePairs',{'nVarToSample','all'});
    classifier = classifier.train(TrainingDataSet);    % Train
    classified = run(classifier, TestDataSet);         % Test
    subplot(2,1,1);
    classifier.plot;
    subplot(2,1,2);
    [pf,pd] = prtScoreRoc(classified,TestDataSet);
    h = plot(pf,pd,'linewidth',3);
    title('ROC'); xlabel('Pf'); ylabel('Pd');</pre></div><!--after help -->
   </body>
</html>